package com.rd.student.jike.class1.sunhao.day03;

import java.util.ArrayList;
import java.util.Random;

public class Test8 {
    public static void main(String[] args) {
        ArrayList<Score> arrayList = new ArrayList();
        ArrayList<Score> arrayList1 = new ArrayList();
        for (int i=0;i<20;i++){
            Score score = new Score();
            score.id=i+1;
            arrayList.add(score);
        }
        for (int i=0;i<arrayList.size();i++){
            if (arrayList.get(i).score<60){
                arrayList1.add(arrayList.get(i));
                arrayList.remove(i);
            }

        }
        System.out.println("大于六十分的是");
       for (int i = 0;i<arrayList.size();i++){
           System.out.print(arrayList.get(i).id+" ");
       }
        System.out.println();
        System.out.println("小于六十分的是");
        for (int i = 0;i<arrayList1.size();i++){
            System.out.print(arrayList1.get(i).id+" " );
        }
    }
}

class Score{
    Random random = new Random();
    int id;
    int score;
    public Score(){
        this.score=random.nextInt(101);
    }
}
